<?php

namespace app\common\model;

/**
 * Class ConsultingComment
 * @package app\model
 * @property int	$id
 * @property int	$consultingId
 * @property int	$memberId
 * @property int	$lawyerId
 * @property int	$level
 * @property string	$content
 * @property int	$updated
 * @property int	$created
 * @link https://www.kancloud.cn/manual/thinkphp6_0/1037579
 * @link https://www.kancloud.cn/manual/think-orm/1257998
 * @link https://www.kancloud.cn/thinkphp/master-database-and-model/265551
 */
class ConsultingComment extends \app\common\model\BaseModel
{
    protected $name = 'ConsultingComment';

    // 用户
    public function member()
    {
        return $this->belongsTo(Member::class, 'memberId', 'id');
    }

    // 律师
    public function lawyer()
    {
        return $this->hasOne(Member::class, 'id', 'lawyerId');
    }

    /**
     * 1对1
     * @return \think\model\relation\HasOne
     */
    //    public function one(){
    //        return $this->hasOne( Test1::class, 'Test1表中的键', 'ConsultingComment表中的键');
    //    }

    /**
     * 1对多
     * @return \think\model\relation\HasMany
     */
    //    public function many(){
    //        return $this->hasMany( Test1::class, 'Test1表中的键', 'ConsultingComment表中的键');
    //    }

    /**
     * 多对多
     * @return \think\model\relation\BelongsToMany
     */
    //    public function belongs(){
    //        return $this->belongsToMany( Test1::class, '中间表', '中间表中Test1的键', '中间表中ConsultingComment的键');
    //    }
}
